function subdirs = initializeML
    root_dir = pwd;
    subdirs = allSubDirs(root_dir);
    externs = [root_dir '/../externs/liblinear-1.93/matlab:' ...
               root_dir '/../externs/bpp:' ...
              ];
    
    subdirs = [subdirs externs];
    addpath(subdirs);
end

function subdirs = allSubDirs(p)
    subdirs_str = genpath(p);
    colon_pos = strfind(subdirs_str, ':');
    begin = 1;
    j = 1;
    for i = 1:length(colon_pos)
        a = [subdirs_str(begin:colon_pos(i)-1) ':'];
        if isempty(strfind(a,'.')) % skip svn folders
            %a
            sub{j} = a;
            j = j+1;
        end
        begin = colon_pos(i)+1;
    end
    subdirs = '';
    for i = 1:length(sub)
        subdirs = [subdirs sub{i}];
    end
end
